<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>页面跳转</title>
    <style>
       body{
           text-align: center;
       }
    </style>
</head>
<body>
<div><img src="image/1.jpg" id="pic" height="350px">
    <p id="p"><span id="num" style="color: red;font-size: 50px">5</span>秒后将跳转到黄色网站<br/>蜻蜓队长写给戒烟看的</p></div>

</body>
</html>
<script>
    //首先改变数字
    setInterval(changeNumber,1000);
    let time = 4;
    function changeNumber() {
        //时间为0跳转页面
        if(time == 0){
            location.href = "https://baike.baidu.com/item/%E9%BB%84%E8%89%B2%E7%BD%91%E7%AB%99/389303?fromtitle=%E9%BB%84%E7%BD%91&fromid=12013312&fr=aladdin";
        }
        document.getElementById("num").innerText = time;
        time--;
    }
</script>